package cn.livingCloud.dto;

import cn.livingCloud.entity.content.ReplyRule;
import cn.livingCloud.entity.content.TextReplyContent;
import cn.livingCloud.wechat.protocol.MsgType;

/**
 * Created by 唐旭 on 2015/12/26.
 */
public class TextReplyRuleFormDto extends ReplyRuleFormDto {
    private TextReplyContentDto content;

    public TextReplyRuleFormDto() {
        super();
        this.setMsgType(MsgType.text);
    }

    public TextReplyRuleFormDto(ReplyRule replyRule) {
        super(replyRule);
        TextReplyContent content = (TextReplyContent) replyRule.getContent();
        this.content = new TextReplyContentDto(content);
    }

    public TextReplyContentDto getContent() {
        return content;
    }

    public TextReplyRuleFormDto setContent(TextReplyContentDto content) {
        this.content = content;
        return this;
    }

    public void update(TextReplyContent content) {
        content.setContent(this.content.getContent());
    }
}
